<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    let user = {
        name : '老郑',
        content: '帅'
    }
     let type = '牛'
    Object.defineProperty(user,'content',{
        enumerable : true,
        configurable: true,

        get(){
            console.log('取数据操作:' +content);
            console.log(type);
          
            return content
        },
        set(newValue){
            console.log('修改数据 : '+newValue);
            content = newValue
        }
    })
    user.content = '大脸'
    console.log(user.content);
    console.log(user.name);



</script>
    

</script>
</html>